let vue=new Vue({
   el:'.tab-content',
   data:{
       result:{},
       startDate:'',
       endDate:'',
       status:''
   } ,
    methods:{
       select:function (pageNum,pageSize) {
           axios({
               url:`work/admin/index/${pageNum}/${pageSize}`,
               method:'post',
               data: {'startDate': this.startDate,
                      'endDate':this.endDate,
                      'status':this.status
               }
           }).then(rs=>{
               this.result=rs.data.obj
           }).catch(error=>{
               layer.msg(error.message)
           })
       },
        selectAll:function (pageNum,pageSize) {
            this.startDate='';
                this.endDate='';
                this.status='';
            axios({
                url:`work/admin/index/${pageNum}/${pageSize}`,
                method:'post',
                data: {'startDate': this.startDate,
                    'endDate':this.endDate,
                    'status':this.status
                }
            }).then(rs=>{
                this.result=rs.data.obj
            }).catch(error=>{
                layer.msg(error.message)
            })
        },
        detail:function (id) {
           layer.id=id;
            layer.open({
                type:2,
                title:false,
                area:['80%','80%'],
                content: 'work/admin/detail',
                end:()=>{
            }
            })
        },
        toUpdate:function (id) {
           layer.message='';
            layer.uid=id;
            layer.open({
                type: 2,
                title: false,
                area: ['80%','80%'],
                content:'demand/toUpdate',
                end:()=>{
                    if (layer.message!=''){
                        layer.msg(layer.message);
                        this.select(1,5)
                    }
                }
            })
        },
        toPrint:function (id) {
            layer.id=id;
            layer.open({
                type:2,
                title:false,
                area:['80%','80%'],
                content: 'work/admin/toPrint',
                end:()=>{
                }
            })
        }
    },
    created:function () {
        this.select(1,5)
    }
});